<?php
define("_needlogin", "1");
define("_access", "1");
include_once("../include/db.config.php"); 
$sql = "SELECT id,category,files,name,value,solves,description from challenge where enable=1";
$r = array();
$r['game'] = getAll($sql);
foreach ($r['game'] as $key => &$value) {
    if(!$value['files']){
        $value['files'] = array();
    }
}


echo json_encode($r);